{extend name="$base" /}
{block name="resources"}
<script type="text/javascript" src="__STATIC__/My97DatePicker/WdatePicker.js"></script>
{/block}
{block name="main"}
<table class="mytable">
	<tr>
		<td width="10%">
			<input type="text" id='startDate' placeholder="请选择开始日期" class="input-medium input-common" onclick="WdatePicker()"/>
			&nbsp;-&nbsp;
			<input type="text" id='endDate' placeholder="请选择结束日期" class="input-medium input-common" onclick="WdatePicker()" />
			<input type="text" id='search_text' placeholder="请输入操作人" class="input-common" />
			<input type="button" onclick="searchData()" value="搜索" class="btn-common"/>
		</td>
	</tr>
</table>
<table class="table-class">
	<colgroup>
		<col style="width: 15%;">
		<col style="width: 20%;">
		<col style="width: 30%;">
		<col style="width: 25%;">
		<col style="width: 10%;">
	</colgroup>
	<thead>
		<tr align="center">
			<th>操作人</th>
			<th style="text-align:left;">操作方法（控制器/方法）</th>
			<th style="text-align:left;">数据</th>
			<th>时间</th>
			<th style="text-align:left;">IP</th>
		</tr>
	</thead>
	<colgroup>
		<col style="width: 15%;">
		<col style="width: 20%;">
		<col style="width: 30%;">
		<col style="width: 25%;">
		<col style="width: 10%;">
	</colgroup>
	<tbody></tbody>
</table>

{/block}
{block name="script"}
<script type="text/javascript">
function LoadingInfo(page_index) {
	var search_text = $("#search_text").val();
	var start_date = $("#startDate").val();
	var end_date = $("#endDate").val();
	$.ajax({
		type : "post",
		url : "{:__url('ADMIN_MAIN/member/userOperationLogList')}",
		data : { "page_index" : page_index, "page_size" : $("#showNumber").val(), "search_text":search_text, "start_date":start_date, "end_date":end_date },
		success : function(data) {
			if (data["data"].length > 0) {
				$(".table-class tbody").empty();
				for (var i = 0; i < data["data"].length; i++) {
					var html = '';
					html += '<tr align="center">';
					if(data["data"][i]["user_name"]==null || data["data"][i]["user_name"] == undefined){
						html += '<td>--</td>';
					}else{
						html += '<td>'+ data["data"][i]["user_name"] +'</td>';
					}
					html += '<td style="text-align:left;">'+data["data"][i]["controller"]+'/'+data["data"][i]["method"]+'</td>';
					html += '<td style="text-align:left;word-break:break-all">'+ data["data"][i]["data"] +'</td>';	
					html += '<td align="center">'+ timeStampTurnTime(data["data"][i]["create_time"]) +'</td>';
					html += '<td style="text-align:left;">'+ data["data"][i]["ip"] +'</td>';
					html += '</tr>';
					$(".table-class tbody").append(html);
				}
			} else {
				var html = '<tr align="center"><td colspan="9">暂无符合条件的数据记录</td></tr>';
				$(".table-class tbody").html(html);
			}
			initPageData(data["page_count"],data['data'].length,data['total_count']);
			$("#pageNumber").html(pagenumShow(jumpNumber,$("#page_count").val(),{$pageshow}));
		}
	});
}

function searchData(){
	LoadingInfo(1);
}
</script>
{/block}